package com.atguigu.daijia.order.client;

import com.atguigu.daijia.common.result.Result;
import com.atguigu.daijia.model.entity.order.OrderInfo;
import com.atguigu.daijia.model.form.order.OrderInfoForm;
import com.atguigu.daijia.model.form.order.StartDriveForm;
import com.atguigu.daijia.model.form.order.UpdateOrderBillForm;
import com.atguigu.daijia.model.form.order.UpdateOrderCartForm;
import com.atguigu.daijia.model.vo.base.PageVo;
import com.atguigu.daijia.model.vo.order.CurrentOrderInfoVo;
import com.atguigu.daijia.model.vo.order.OrderBillVo;
import com.atguigu.daijia.model.vo.order.OrderProfitsharingVo;
import com.atguigu.daijia.model.vo.order.OrderRewardVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(value = "service-order")
public interface OrderInfoFeignClient {

    /*
     * 保存订单信息
     * */
    @PostMapping("/order/info/saveOrderInfo")
    public Result<Long> saveOrderInfo(@RequestBody OrderInfoForm orderInfoForm);

    /*
     * 根据订单id获取订单信息
     * */
    @GetMapping("/order/info/getOrderStatus/{orderId}")
    public Result<Integer> getOrderStatus(@PathVariable Long orderId);

    /*
     * 司机抢单
     * */
    @GetMapping("/order/info/robNewOrder/{driverId}/{orderId}")
    public Result<Boolean> robNewOrder(@PathVariable Long driverId, @PathVariable Long orderId);

    /*
     * 乘客端查找当前订单
     * */
    @GetMapping("/order/info/searchCustomerCurrentOrder/{customerId}")
    public Result<CurrentOrderInfoVo> searchCustomerCurrentOrder(@PathVariable Long customerId);

    /*
     * 司机端查找当前订单
     * */
    @GetMapping("/order/info/searchDriverCurrentOrder/{customerId}")
    public Result<CurrentOrderInfoVo> searchDriverCurrentOrder(@PathVariable Long customerId);

    /*
     * 根据订单id获取订单信息
     * */
    @GetMapping("/order/info/getOrderInfo/{orderId}")
    public Result<OrderInfo> getOrderInfo(@PathVariable Long orderId);

    /*
     * 司机到达起始点
     * */
    @GetMapping("/order/info/driverArriveStartLocation/{orderId}/{driverId}")
    public Result<Boolean> driverArriveStartLocation(@PathVariable Long orderId, @PathVariable Long driverId);

    /*
     * 更新代驾车辆信息
     * */
    @PostMapping("/order/info/updateOrderCart")
    public Result<Boolean> updateOrderCart(@RequestBody UpdateOrderCartForm updateOrderCartForm);

    /*
     * 开启代驾
     * */
    @PostMapping("/order/info/startDriver")
    public Result<Boolean> startDriver(@RequestBody StartDriveForm startDriveForm);

    /*
     * 根据订单段获取订单数
     * */
    @GetMapping("/order/info/getOrderNumByTime/{startTime}/{endTime}")
    public Result<Long> getOrderNumByTime(@PathVariable Long startTime, @PathVariable Long endTime);

    /*
     * 结束代驾服务更新订单账单
     * */
    @PostMapping("/order/info/endDrive")
    public Result<Boolean> endDrive(@RequestBody UpdateOrderBillForm updateOrderBillForm);

    /*
     * 获取乘客订单分页列表
     * */
    @GetMapping("/order/info/findCustomerOrderPage/{customerId}/{page}/{limit}")
    public Result<PageVo> findCustomerOrderPage(
            @PathVariable Long customerId,
            @PathVariable Long page,
            @PathVariable Long limit
    );

    /*
     * 获取司机订单分页列表
     * */
    @GetMapping("/order/info/findDriveOrderPage/{customerId}/{page}/{limit}")
    public Result<PageVo> findDriveOrderPage(
            @PathVariable Long customerId,
            @PathVariable Long page,
            @PathVariable Long limit
    );

    /*
     * 根据订单id获取实际账单信息
     * */
    @GetMapping("/order/info/getOrderBillInfo/{orderId}")
    public Result<OrderBillVo> getOrderBillInfo(@PathVariable Long orderId);

    /*
     * 根据订单id获取实际分账信息
     * */
    @GetMapping("/order/info/getOrderProfitsharing/{orderId}")
    public Result<OrderProfitsharingVo> getOrderProfitsharing(@PathVariable Long orderId);

    /*
     * 发送账单信息
     * */
    @GetMapping("/order/info/sendOrderBillInfo/{orderId}/{driverId}")
    public Result<Boolean> sendOrderBillInfo(@PathVariable Long orderId, @PathVariable Long driverId);

    /*
     * 更改订单支付状态
     * */
    @GetMapping("/order/info/updateOrderPayStatus/{orderNo}")
    public Result<Boolean> updateOrderPayStatus(@PathVariable String orderNo);

    /*
     * 获取订单的系统奖励
     * */
    @GetMapping("/order/info/getOrderRewardFee/{orderNo}")
    public Result<OrderRewardVo> getOrderRewardFee(@PathVariable String orderNo);
}